<template>
  <div>
    <!--    头部组件-->
    <Header />
    <!--    主体区域-->
    <el-table :data="list">
      <!--      channelMaxCapacity: 10-->
      <!--      image: "http://lkd2-java.itheima.net/image/售货机.jpg"-->
      <!--      model: "AC204"-->
      <!--      name: "饮料机"-->
      <!--      typeId: 1-->
      <!--      vmCol: 10-->
      <!--      vmRow: 10-->
      <el-table-column label="序号">
        <template v-slot="{ $index }">
          {{ $index + 1 + (params.pageIndex - 1) * 10 }}
        </template>
      </el-table-column>
      <el-table-column label="类型名称" prop="name" />
      <el-table-column label="型号编码" prop="model" />
      <el-table-column label="设备图片">
        <template v-slot="{ row }">
          <img
            :src="row.image"
            alt=""
            style="
              height: 30px;
              width: 30px;
              line-height: 30px;
              border-radius: 50%;
            "
          >
        </template>
      </el-table-column>
      <el-table-column label="货道行" prop="vmRow" />
      <el-table-column label="货道列" prop="vmCol" />
      <el-table-column label="设备容量" prop="channelMaxCapacity" />
      <el-table-column label="操作">
        <el-button type="text">修改</el-button>
        <el-button style="color: red" type="text">删除</el-button>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import Header from '@/components/Hander/index'
import { getTypeList } from '@/api/type'

export default {
  name: 'IndexVue',
  components: {
    Header
  },
  data() {
    return {
      list: [],
      params: {
        pageIndex: 1,
        pageSize: 10
      }
    }
  },
  created() {
    this.getTypeList()
  },
  methods: {
    async getTypeList() {
      const res = await getTypeList(this.params)
      this.list = res.currentPageRecords
      console.log(this.list)
    }
  }
}
</script>

<style scoped></style>
